package com.wondertek.poms.pre.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wondertek.poms.pre.manager.StartProcess;
import com.wondertek.poms.pre.rabbitmq.common.QueueContent;

import lombok.extern.slf4j.Slf4j;

@Component
@Slf4j
@RabbitListener(queues = QueueContent.MESSAGE_QUEUE_NAME) // 监听延时队列
public class DelayMessageListener {
	@Autowired
    private StartProcess startProcess;

    @RabbitHandler
    public void receiveContentTopic(String message) {
        log.info("内容同步主流程前置流程|接收延时队列|mq消息：" + message);
        startProcess.slowProcess(message);
    }
}
